﻿@model XSTDZ.ERP.Application.DataContracts.UserDto
@using XSTDZ.ERP.Infrastructure.Extentions
@{
    ViewBag.Title = " - 编辑用户";
}
@section header{
     <link href="@Url.Content("~/Content/Controls.css")" rel="stylesheet" type="text/css" />
 <link href="@Url.Content("~/Content/Form.css")" rel="stylesheet" type="text/css" />
}
<h2>编辑用户</h2>
<div class="wp100">

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)

    <table class="formtable">
    <thead>
        <tr>
            <th colspan="4">@* <h2>新增入库单</h2>*@
            <div id="toptoolbar"></div>
            </th>
        </tr>
    </thead>

<tr>
        <td class="title">@Html.LabelFor(model => model.AccountName)<b>*</b></td>
        <td>
            @Html.TextBoxFor(model => model.AccountName, new { @class = "text" })
            @Html.ValidationMessageFor(model => model.AccountName)
            @Html.HiddenFor(model=>model.Id)
            @Html.HiddenFor(model=>model.CreateID)
            @Html.HiddenFor(model=>model.CreateTime)
        </td>

        <td class="title"> 
            @Html.LabelFor(model => model.Name)<b>*</b>
        </td>
        <td>
            @Html.TextBoxFor(model => model.Name, new { @class = "text", value = DateTime.Now.ToString("yyyy-MM-dd") })
            @Html.ValidationMessageFor(model => model.Name)
        </td>
   </tr>
       
    <tr>
         <td class="title">
            @Html.LabelFor(model => model.Password)<b>*</b>
       </td>
         <td>
            @Html.PasswordFor(model => model.Password, new { @class = "text", value = @Model.Password})
            @Html.ValidationMessageFor(model => model.Password)
        </td>
         <td class="title">
            @Html.LabelFor(model => model.Gender)
        </td>
         <td>
            @Html.RadioButtonList("Gender", ViewBag.Gender as IEnumerable<SelectListItem>)
        </td>
    </tr>

      <tr>
        <td class="title">
            @Html.LabelFor(model => model.Birthday)
         </td>
         <td>
            @Html.TextBoxFor(model => model.Birthday)
            <input type="hidden" value="@Model.Birthday" id="birthdayVal" name="birthdayVal" />
            @Html.ValidationMessageFor(model => model.Birthday)
        </td>
           <td class="title">
            @Html.LabelFor(model => model.Address)
        </td>
           <td> 
            @Html.TextBoxFor(model => model.Address, new { @class = "text" })
            @Html.ValidationMessageFor(model => model.Address)
        </td>
      </tr>
       
     <tr>
        <td class="title">
            @Html.LabelFor(model => model.Mobile)
        </td>
         <td>
            @Html.TextBoxFor(model => model.Mobile, new { @class = "text" })
            @Html.ValidationMessageFor(model => model.Mobile)
        </td>
          <td class="title">
            @Html.LabelFor(model => model.Tel)
        </td>
           <td>  
            @Html.TextBoxFor(model => model.Tel, new { @class = "text" })
            @Html.ValidationMessageFor(model => model.Tel)
        </td>
      </tr>

       <tr>
         <td class="title">
            @Html.LabelFor(model => model.PostNo)
        </td>
         <td> 
            @Html.TextBoxFor(model => model.PostNo, new { @class = "text" })
            @Html.ValidationMessageFor(model => model.PostNo)
        </td>
           <td class="title">
            @Html.LabelFor(model => model.Email)
        </td>
           <td> 
            @Html.TextBoxFor(model => model.Email, new { @class = "text" })
            @Html.ValidationMessageFor(model => model.Email)
        </td>
      </tr>
    
     <tr>
        <td class="title">
            @Html.LabelFor(model => model.QQ)
        </td>
         <td> 
            @Html.TextBoxFor(model => model.QQ, new { @class = "text" })
            @Html.ValidationMessageFor(model => model.QQ)
        </td>
          <td class="title">
            @Html.LabelFor(model => model.MSN)
        </td>
           <td> 
            @Html.TextBoxFor(model => model.MSN, new { @class = "text"})
            @Html.ValidationMessageFor(model => model.MSN)
        </td>
      </tr>

   <tr>
           <td class="title">
            @Html.LabelFor(model => model.DeptId)<b>*</b>
       </td>
           <td>
           <input type="text" id="txtDeptName" name="txtDeptName"  class="text" value="@Model.Dept.Name" /><a href="javascript:void(0);" onclick="javascript:selectOrg();" >选择</a>
           @Html.HiddenFor(model => model.DeptId)
          @*  @Html.TextBoxFor(model => model.DeptId, new  @class = "text none" })
            @Html.ValidationMessageFor(model => model.DeptId)*@
        </td>
        <td class="title">
           @* @Html.LabelFor(model => model.RoleIds)<b>*</b>*@
            @Html.HiddenFor(model => model.RoleIds)
            @Html.LabelFor(model => model.IsPiece)
       </td>
           <td>
           @* <input type="text"  id="RoleName" name="RoleName" class = "text" />*@
             <input type="hidden" id="RoleNameVal" name="RoleNameVal" value="@ViewBag.StringRoleIds" />
           @* @Html.TextBoxFor(model => model.RoleName, new { @class = "text" })
            <input type="hidden" id="RoleNameVal" name="RoleNameVal" value="@ViewBag.StringRoleIds" />
             @Html.ValidationMessage("RoleNameIds")*@
             @Html.RadioButtonList("IsPiece", ViewBag.IsPiece as IEnumerable<SelectListItem>)
        </td>
      </tr>    
      <tr>
        <td colspan="4"> <p class="divBtn">
          <input type="hidden" id="hidHttpRefeParent" name="hidHttpRefeParent" value="grid" />
            <input type="hidden" id="hidHttpPostState" name="hidHttpPostState" value="@ViewBag.PostState" />
            <input type="submit" value="@XSTDZ.ERP.Infrastructure.SystemConfig.BtnSave"  class="BtnSubmit" />
            <input type="button" value="@XSTDZ.ERP.Infrastructure.SystemConfig.BtnClose" id="btnFromClose" name="btnFromClose" class="BtnClose" />
        </p></td>
      </tr>
     
       </table>
}

</div>

<script type="text/javascript">
    $(document).ready(function () {
        $("#Birthday").ligerDateEditor({ showTime: true, format: "yyyy-MM-dd", labelWidth: 140, labelAlign: 'left'
        });
        var birthday = $("#birthdayVal").val();
//        if (birthday != undefined && birthday.toString().length > 0) {
//            birthday = birthday.toString("yyyy-MM-dd");
//        }

        $("#Birthday").ligerGetDateEditorManager().setValue(birthday);
    });
    function selectOrg() {
        var returnValue = window.showModalDialog('../Org/SelectOrgTree', window, "help:No;resizable:No;status:No;scroll:yes;dialogWidth=300px;dialogHeight=300px");
        $("#txtDeptName").val(returnValue[0]);
        $("#DeptId").val(returnValue[1]);

    }



</script>
<script type="text/javascript" src="@Url.Content("~/Content/js/formBase.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Content/js/User/Add.js")"></script>